import { ACCESS_TOKEN } from '@/constant';
import { create } from 'zustand';

export const useStore = create((set) => ({
    userInfo: {}, // 用户信息
    access_token: undefined, // 登录之后的token, 部分接口不是公开的，请求头需要带上token才能请求
    setUserInfo: (userInfo: any) => set({userInfo: userInfo}),
    setAccessToken: (access_token: string) => set({access_token: access_token}),
    removeAll: () => set({userInfo: {}, access_token: undefined}),
}));

